package com.ruoyi.funding.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.funding.mapper.FundingAllocationCopyMapper;
import com.ruoyi.funding.domain.FundingAllocationCopy;
import com.ruoyi.funding.service.IFundingAllocationCopyService;

/**
 * 资金拨款记录历史Service业务层处理
 * 
 * @author gw
 * @date 2025-01-15
 */
@Service
public class FundingAllocationCopyServiceImpl implements IFundingAllocationCopyService 
{
    @Autowired
    private FundingAllocationCopyMapper fundingAllocationCopyMapper;

    /**
     * 查询资金拨款记录历史
     * 
     * @param historyId 资金拨款记录历史主键
     * @return 资金拨款记录历史
     */
    @Override
    public FundingAllocationCopy selectFundingAllocationCopyByHistoryId(Long historyId)
    {
        return fundingAllocationCopyMapper.selectFundingAllocationCopyByHistoryId(historyId);
    }

    /**
     * 查询资金拨款记录历史列表
     * 
     * @param fundingAllocationCopy 资金拨款记录历史
     * @return 资金拨款记录历史
     */
    @Override
    public List<FundingAllocationCopy> selectFundingAllocationCopyList(FundingAllocationCopy fundingAllocationCopy)
    {
        return fundingAllocationCopyMapper.selectFundingAllocationCopyList(fundingAllocationCopy);
    }

    /**
     * 新增资金拨款记录历史
     * 
     * @param fundingAllocationCopy 资金拨款记录历史
     * @return 结果
     */
    @Override
    public int insertFundingAllocationCopy(FundingAllocationCopy fundingAllocationCopy)
    {
        fundingAllocationCopy.setCreateTime(DateUtils.getNowDate());
        return fundingAllocationCopyMapper.insertFundingAllocationCopy(fundingAllocationCopy);
    }

    /**
     * 修改资金拨款记录历史
     * 
     * @param fundingAllocationCopy 资金拨款记录历史
     * @return 结果
     */
    @Override
    public int updateFundingAllocationCopy(FundingAllocationCopy fundingAllocationCopy)
    {
        fundingAllocationCopy.setUpdateTime(DateUtils.getNowDate());
        return fundingAllocationCopyMapper.updateFundingAllocationCopy(fundingAllocationCopy);
    }

    /**
     * 批量删除资金拨款记录历史
     * 
     * @param historyIds 需要删除的资金拨款记录历史主键
     * @return 结果
     */
    @Override
    public int deleteFundingAllocationCopyByHistoryIds(Long[] historyIds)
    {
        return fundingAllocationCopyMapper.deleteFundingAllocationCopyByHistoryIds(historyIds);
    }

    /**
     * 删除资金拨款记录历史信息
     * 
     * @param historyId 资金拨款记录历史主键
     * @return 结果
     */
    @Override
    public int deleteFundingAllocationCopyByHistoryId(Long historyId)
    {
        return fundingAllocationCopyMapper.deleteFundingAllocationCopyByHistoryId(historyId);
    }

    @Override
    public List<FundingAllocationCopy> selectFundingAllocationCopyByAllocationId(Long allocationId) {
        return fundingAllocationCopyMapper.selectFundingAllocationCopyByAllocationId(allocationId);
    }

}
